package com.relytosoft.mizar.media.camera.api.pojo.query;

import com.relytosoft.dubhe.common.core.utils.BeanCopyUtils;
import com.relytosoft.mizar.media.camera.api.pojo.dto.VideoRecordDto;
import com.relytosoft.mizar.media.common.enums.ResourceTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @author wss
 * @version 1.0
 * @date 2022/6/16 13:52
 */
@ApiModel("离线开始请求")
public class OfflineStartQuery implements Serializable {

    @ApiModelProperty(value = "流地址")
    private String streamUrl;

    @ApiModelProperty(value = "设备id")
    private Integer deviceId;

    @ApiModelProperty(value = "持续时长 单位s")
    private Long duration;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    public static VideoRecordDto buildDto(OfflineStartQuery offlineStartQuery) {
        VideoRecordDto videoRecordDto = new VideoRecordDto();
        BeanCopyUtils.copy(offlineStartQuery, videoRecordDto);
        videoRecordDto.setResourceTypeEnum(ResourceTypeEnum.MANUAL_VIDEO);
        return videoRecordDto;
    }

    public String getStreamUrl() {
        return streamUrl;
    }

    public void setStreamUrl(String streamUrl) {
        this.streamUrl = streamUrl;
    }

    public Integer getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Integer deviceId) {
        this.deviceId = deviceId;
    }

    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    @Override
    public String toString() {
        return "OfflineStartQuery{" +
                "streamUrl='" + streamUrl + '\'' +
                ", deviceId=" + deviceId +
                ", duration=" + duration +
                ", taskName='" + taskName + '\'' +
                '}';
    }
}
